(function () {
    'use strict';

    angular
    .module('app')
    .factory('APIPaymentService', APIPaymentService);

    APIPaymentService.$inject =  ['$http', '$q', '$timeout', 'CacheFactory','ENUM'];

    function APIPaymentService($http, $q, $timeout, CacheFactory, ENUM) {

        var service = new APIEndpoint( $http, $q, $timeout, CacheFactory, 'APIPaymentService' );

        service.getPayParam = function( params ) {
            return this.fetch( '/weixin/weixin/getPayParam', params, false, function(res){
                return ENUM.ERROR_CODE.OK == res.data.code ? res.data.data : null;
            });
        };

        service.getPayType = function( params ) {
            return this.fetch( '/weixin/order/getPayType', params, false, function(res){
                return ENUM.ERROR_CODE.OK == res.data.code ? res.data.data : null;
            });
        };

        return service;
    }

})();
